package com.chester.quickstarter.util.common;

import com.alibaba.fastjson.JSONObject;

/**
 * @author chester7cheng
 */
public class JsonResultUtil {

    public static JSONObject generateFailJson(String message){
        JSONObject result = new JSONObject();
        result.put("state", "fail");
        result.put("message", message);

        return result;
    }

    public static JSONObject generateSuccessJson(Object data){
        JSONObject result = new JSONObject();
        result.put("state", "success");
        result.put("data", data);

        return result;
    }
}
